package com.bleeth.fx.component;

import com.bleeth.fx.font.MFontIcon;
import javafx.geometry.Pos;
import javafx.scene.layout.Region;
import javafx.scene.layout.VBox;
import javafx.scene.paint.Color;
import lombok.Builder;

/**
 * @author Sakura
 * @version 1.0
 * @date 2021-11-13 22:17
 **/
@Builder
public class MIcon {

    private static final String TAG = "el-icon";

    @Builder.Default
    private String color = "#606266";

    @Builder.Default
    private double size = 30;

    @Builder.Default
    private String icon = "icon-loading";

    public Region make() {
        VBox box = new VBox();
        MFontIcon mFontIcon = new MFontIcon(icon, size, Color.web(color));
        box.setAlignment(Pos.CENTER);
        box.setFillWidth(false);
        box.getChildren().add(mFontIcon);
        box.setPrefHeight(size);
        box.setPrefWidth(size);
        box.setMaxHeight(size);
        return box;
    }

}
